package com.damon.authority.dal.entity;

import com.kylin.shared.common.entity.BaseEntry;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 权限系统的权限数据项
 * @author Damon S.
 * @version v1.0.1
 * @date 2019年11月01日 10:57
 */
@Entity
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table(name = "t_platform_permission", catalog = "db_kylin_artwork")
public final class PermissionEntry extends BaseEntry implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", unique = true)
    private Long permissionId;

    /** 权限主体Id: tenantId 或roleId */
    @Column(name = "subject_id")
    private Long subjectId;

    /** 权限类型：1:租户权限，2:角色权限 */
    @Column private Integer type;

    @Column
    private String permissions;

    /** 区分不同系统 */
    @Column(length = 16)
    private String catalog;
}
